﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="fclbasedatagrid.aspx.cs" Inherits="LTJ.WebPage.SystemManage.basedata.fclbasedatagrid" %>
<%@ Import Namespace="LTJ.Common"%>
<%@ Register TagPrefix="dyj" Namespace="LTJ.Control" Assembly="LTJ.Control" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=7" />
    <title>基础数据管理</title>
    <link href="../css/comm.css" type="text/css" rel="stylesheet" />
    <link href="../css/lightview.css" type="text/css" rel="stylesheet" />
    <script src="../js/jquery.js" type="text/javascript"></script>
    <script src="../js/prototype.js" type="text/javascript"></script>
    <script src="../js/scriptaculous.js?load=effects" type="text/javascript"></script>
    <script src="../js/lightview.js" type="text/javascript"></script>
    <script src="../js/effects.js" type="text/javascript"></script>
    <script language="javascript" type="text/javascript" src="../js/common.js"></script>
    <script language="javascript" type="text/javascript" src="../js/modalpopup.js"></script>
    <script type="text/javascript">
        function Check(form, checked) {
            CheckByName(form, 'cid', checked);
            checkedEnabledButton(form, 'cid', 'del');
        }
        function formcheck() {
            if (event.keyCode == 13) {
                document.getElementById("check").focus();
            }
        }
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div class="adnr">
	    <ul class="adnr2 mar_top">
            <dyj:Button ID="add" runat="server" Text="新增" ButtonImgUrl="../images/add.gif" OnClientClick="return newMenu();"/>&nbsp;&nbsp;
		    <dyj:Button ID="del" runat="server" Text="删除" ButtonImgUrl="../images/del.gif" Enabled="false" OnClientClick="if(!confirm('您确定要删除基础数据信息!'))return;"/>&nbsp;&nbsp;
	    </ul>
	    <div class="adnr3">
        <dyj:datagrid id="DataGrid1" runat="server" PageSize="10">
	       <Columns>
            <asp:TemplateColumn HeaderText="<input title='选中/取消' onclick='Check(this.form,this.checked)' type='checkbox' name='chkall' id='chkall' />">
                <HeaderStyle Width="20px" />
                <ItemTemplate>
                    <input id="cid" type="checkbox" onclick="checkedEnabledButton(form, 'cid', 'del')" value="<%# DataBinder.Eval(Container, "DataItem.id").ToString()%>" name="cid">
                </ItemTemplate>
            </asp:TemplateColumn>
            <asp:TemplateColumn HeaderText="操作">
              <ItemTemplate>
                <a href="javascript:;" class="l_blue" onclick="editMenu('<%# DataBinder.Eval(Container, "DataItem.id").ToString() %>','<%# DataBinder.Eval(Container, "DataItem.tcode").ToString() %>','<%# DataBinder.Eval(Container, "DataItem.name").ToString() %>','<%# DataBinder.Eval(Container, "DataItem.ename").ToString() %>');">编辑</a>&nbsp;
              </ItemTemplate>
            </asp:TemplateColumn>
            <asp:BoundColumn DataField="tcode" HeaderText="编码"></asp:BoundColumn>
            <asp:BoundColumn DataField="name" HeaderText="名称"></asp:BoundColumn>
            <asp:BoundColumn DataField="ename" HeaderText="英文"></asp:BoundColumn>
            <asp:TemplateColumn HeaderText="起运港" Visible="false">
              <ItemTemplate>
                    <%# DataBinder.Eval(Container, "DataItem.expand1").ToString()=="1"?"是":"否"%>
              </ItemTemplate>
            </asp:TemplateColumn>
            <asp:BoundColumn DataField="seaname" HeaderText="航线" Visible="false"></asp:BoundColumn>
            <asp:BoundColumn DataField="countryname" HeaderText="国家" Visible="false"></asp:BoundColumn>
          </Columns>
	    </dyj:datagrid>
	    </div>
	    <i class="tp"></i><i class="bt"></i>
    </div>
    <button id="reclick" runat="server" style="display:none"></button>
    <div id="BOX_overlay" style="background: #000; position: absolute; z-index: 101; filter: alpha(opacity=50); -moz-opacity: 0.6; opacity: 0.6;">
    </div>
    <div id="neworeditmainmenu" style="display: none; background: #fff; padding: 10px; border: 1px solid #999; width: 400px;">
        <div class="ManagerForm">
            <fieldset>
                <legend id="opt" style="background: url(../images/icons/icon53.jpg) no-repeat 6px 50%;">
                    新增基本数据</legend>
                <table cellspacing="0" cellpadding="4" class="adtb" width="80%">
                    <thead>
                        <tr>
                            <td>编码</td><td>中文</td><td>英文</td>
                        </tr>
                    </thead>
                    <tbody>
                    <tr>
                        <td><dyj:TextBox runat="server" ID="_code" MaxLength="10" Width="100"></dyj:TextBox></td>
                        <td><dyj:TextBox runat="server" ID="_name" MaxLength="20" Width="100"></dyj:TextBox></td>
                        <td><dyj:TextBox runat="server" ID="_ename" MaxLength="20" Width="100"></dyj:TextBox></td>
                    </tr>
                    </tbody>
                    <tfoot>
                    <tr>
                        <td colspan="3" align="center"><input type="hidden" id="dataid" name="dataid" value="0" />
                        <dyj:Button runat="server" ID="datapost"/>
                            &nbsp;&nbsp;
                        <button class="MgButton" id="Button1" onclick="BOX_remove('neworeditmainmenu');"><img src="../images/del.gif"/>取 消</button>
                        </td>
                    </tr>
                    </tfoot>
                </table>
            </fieldset>
        </div>
    </div>
    <div id="setting" />
    </form>
</body>
<script type="text/javascript">
    function newMenu() {
        var typec = '<%=typecode%>';
        if (typec == 'ports') {
            Lightview.show({ href: '../basedata/fclbasedataset.aspx?opmode=add', rel: 'iframe', options: { width: 600, height: 480} }); return;
        } else {
            document.getElementById("opt").innerHTML = "新建基础数据";
            document.getElementById("dataid").value = "0";
            document.getElementById("_code").value = "";
            document.getElementById("_name").value = "";
            document.getElementById("_ename").value = "";
            BOX_show('neworeditmainmenu');
        }
    }

    function editMenu(menuid, menutitle, etitle, ename) {
        var typec = '<%=typecode%>';
        if (typec == 'ports') {
            Lightview.show({ href: '../basedata/fclbasedataset.aspx?opmode=edit&bdid=' + menuid, rel: 'iframe', options: { width: 600, height: 480} }); return;
        } else {
            document.getElementById("opt").innerHTML = "编辑基础数据";
            document.getElementById("dataid").value = menuid;
            document.getElementById("_code").value = menutitle;
            document.getElementById("_name").value = etitle;
            document.getElementById("_ename").value = ename;
            BOX_show('neworeditmainmenu');
        }
    }
</script>
</html>